import request from './request'
// 设备新增
export const deviceAdd = (addDevice) => {
  return request({
    url: '/device/add',
    method: 'post',
    data: addDevice,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 设备列表
export const deviceList = (params) => {
  return request({
    url: '/device/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

//  设备详情
export const deviceDetail = (deviceId) => {
  return request({
    url: '/device/detail',
    method: 'get',
    param: {
      deviceId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改设备
export const deviceUpdate = (updateDevice) => {
  return request({
    url: '/device/update',
    method: 'post',
    data: updateDevice,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
// 全部设备设备列表
export const deviceGatewayGatewayList = () => {
  return request({
    url: '/deviceGateway/gatewayList',
    method: 'get',
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 获取网关列表
export const deviceGatewayList = (fId) => {
  return request({
    url: '/device/gatewayList',
    method: 'get',
    param: {
      fId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
